#include "stdafx.h"	
#include "../sgp/PaletteEntry.h"
#include "../sgp/Image.h"
#include "../sgp/Font.h"

namespace ja2{ namespace sgp
{
	Font::Font(ImagePtr_t &pVideoObj)
		: m_pObject(pVideoObj), m_pActual(&m_ShadeNeutral)
	{
	}

	void Font::create_palette_tables()
	{
		// Image should have palette
		JA2_ASSERT(m_pObject->palette() != nullptr);
		// Create neutral shade		
		m_ShadeNeutral = Image::create_palette_shaded(*m_pObject->palette(), 255, 255, 255, false);
		// Create red shade
		m_ShadeRed = Image::create_palette_shaded(*m_pObject->palette(), 255, 0, 0, true);
		// Create green shade
		m_ShadeGreen = Image::create_palette_shaded(*m_pObject->palette(), 0, 255, 0, true);
		// Create blue shade
		m_ShadeBlue = Image::create_palette_shaded(*m_pObject->palette(), 0, 0, 255, true);
		// Create yellow shade
		m_ShadeYellow = Image::create_palette_shaded(*m_pObject->palette(), 255, 255, 0, true);
		// Create white shade
		m_ShadeWhite = Image::create_palette_shaded(*m_pObject->palette(), 255, 255, 255, true);
		// the rest are darkening tables, right down to all-black.
//		pObj->pShades[0]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 165, 165, 165, FALSE);
//		pObj->pShades[7]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 135, 135, 135, FALSE);
//		pObj->pShades[8]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 105, 105, 105, FALSE);
//		pObj->pShades[9]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 75, 75, 75, FALSE);
//		pObj->pShades[10]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 45, 45, 45, FALSE);
//		pObj->pShades[11]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 36, 36, 36, FALSE);
//		pObj->pShades[12]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 27, 27, 27, FALSE);
//		pObj->pShades[13]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 18, 18, 18, FALSE);
//		pObj->pShades[14]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 9, 9, 9, FALSE);
//		pObj->pShades[15]=Create16BPPPaletteShaded( pObj->pPaletteEntry, 0, 0, 0, FALSE);
	}
} /*sgp*/} /*ja2*/
